<template>
  <Card :tab-list="tabListTitle" v-bind="$attrs" :active-tab-key="activeKey" @tab-change="onTabChange">
    <p v-if="activeKey === 'tab1'">
      <VisitAnalysis :type="'1'" />
    </p>
    <p v-if="activeKey === 'tab2'">
      <VisitAnalysis :type="'2'" />
    </p>
    <p v-if="activeKey === 'tab3'">
      <VisitAnalysis :type="'3'" />
    </p>
  </Card>
</template>
<script lang="ts" setup>
  import { ref } from 'vue';
  import { Card } from 'ant-design-vue';
  import VisitAnalysis from './VisitAnalysis.vue';
  import VisitAnalysisBar from './VisitAnalysisBar.vue';

  const activeKey = ref('tab1');

  const tabListTitle = [
    {
      key: 'tab1',
      tab: '月',
    },
    {
      key: 'tab2',
      tab: '年',
    },
    {
      key: 'tab3',
      tab: '累计',
    },
  ];

  function onTabChange(key) {
    activeKey.value = key;
  }
</script>
